package com.ty.day2;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/15 11:23
 */
public class School {
    String id;
    String name;
    String address;
    Double area;
    Long number;

    public School(String id, String name, String address, Double area, Long number) {
        this.id = id;
        this.name = name;
        this.address = address;
        this.area = area;
        this.number = number;
    }

    public School() {
    }

    public School(String id, String name, String address) {
        this.id = id;
        this.name = name;
        this.address = address;
    }

    public School(Double area) {
        this.area = area;
    }

    public School(Long number) {
        this.number = number;
    }

    public void printName() {
        System.out.println(name);
    }
}

class SchoolDemo {
    public static void main(String[] args) {
        School school = new School();
        school.name = "虫人科";
        school.printName();
        School school1 = new School("001", "虫人科1", "合川");
        school1.printName();
        School school2 = new School("001", "虫人科2", "合川", 100., 100L);
        school2.printName();
        School school3 = new School(100.);
        school3.name="传染科";
        school2.printName();
        School school4 = new School(500L);
        school4.name="出入口";
        school4.printName();
    }
}
